//
//  ZTQuickControl.h
//  BlockUseDemo
//
//  Created by quiet on 15/7/15.
//  Copyright (c) 2015年 quiet. All rights reserved.
//



#pragma mark tableView
//-(void)addTableView
//{
//    ZTTableView *tableView = [[ZTTableView alloc]initWithFrame:self.view.bounds withStyle:UITableViewStylePlain];
//    [self.view addSubview:tableView];
//
//    //获得CELL数组
//    self.cellArr = [[UINib nibWithNibName:@"VC3" bundle:nil]instantiateWithOwner:nil options:nil];
//
//    tableView.scrollEnabled = NO;
//    tableView.backgroundColor = [UIColor redColor];
//
//    [tableView setNumberOfSectionsInTableView:^NSInteger(UITableView *tableView) {
//        return 4;
//    }];
//
//    [tableView setHeightForHeaderInSection:^CGFloat(UITableView *tableView, NSInteger section){
//        return 12;
//    }];
//
//    [tableView setViewForHeaderInSection:^UIView *(UITableView *tableView, NSInteger section) {
//        UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 12)];
//        view.backgroundColor = [UIColor colorWithWhite:0.8 alpha:1];
//        return view;
//    }];
//
//    [tableView setHeightForRowAtIndexPath:^CGFloat(NSIndexPath *indexPath) {
//        UITableViewCell *cell = [self.cellArr objectAtIndex:indexPath.section];
//        return cell.contentView.frame.size.height;
//    }];
//
//    [tableView setNumberOfRowsInSection:^NSInteger(NSInteger section) {
//        return 1;
//    }];
//
//    [tableView setCustomizeCell:^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {
//
//        UITableViewCell* cell = (UITableViewCell*)[self.cellArr objectAtIndex:indexPath.section];
//        cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//        return cell;
//    }];
//
//    [tableView setDidSelectRowAtIndexPath:^(UITableView *tableView, NSIndexPath *indexPath) {
//        switch (indexPath.section) {
//            case 0:
//                NSLog(@"0组被点击");
//                break;
//            case 1:
//                NSLog(@"1组被点击");
//                break;
//            case 2:
//                NSLog(@"2组被点击");
//                break;
//            default:
//                break;
//        }
//    }];
//}


#pragma mark 导航栏
//-(void)setNavigation
//{

//  创建标题图片
//直接使用titleView,在图片拉伸时会出问题
//UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 45, 25)];
//self.navigationItem.titleView = view;
//UIImageView *imageView = [UIView CreateImageViewWithFrame:CGRectMake(view.x+imageView.width/2, 0, 45, 25) image:@"logo_title.png"];
//[view addSubview:imageView];

//    //创建 标题LABEL
//    UILabel * titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 60, 140, 30)];
//    titleLabel.backgroundColor = [UIColor blackColor];
//    titleLabel.text = @"微医发现";
//    titleLabel.textAlignment = NSTextAlignmentCenter;
//    //titleLabel.font = [UIFont systemFontOfSize:16];
//    titleLabel.font = [UIFont boldSystemFontOfSize:20];//加粗
//    titleLabel.textColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1];
//    self.navigationItem.titleView = titleLabel;
//
//    //创建右侧按钮,这样写代码重用性较高
//
//    UIButton *rightButton  = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 25, 25)];
//    [rightButton addTarget:self action:@selector(rightBtnClick:) forControlEvents:UIControlEventTouchUpInside];
//    [rightButton setImage:[UIImage imageNamed:@"home_message_readed_guahao.png"] forState:UIControlStateNormal];
//    [rightButton setImage:[UIImage imageNamed:@"home_message_unread_guahao.png"] forState:UIControlStateSelected];
//
//    UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc]initWithCustomView:rightButton];
//    self.navigationItem.rightBarButtonItem = rightBtn;
//
//    //创建下边线
//    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, self.navigationController.navigationBar.frame.size.height-1, 320, 1)];
//    image.backgroundColor = [UIColor lightGrayColor];
//
//    //设置视图上下图层可传递色彩值
//    //[self.navigationController.navigationBar setBarTintColor:[UIColor blackColor]];
//
//    //设置模糊,默认YES
//    [self.navigationController.navigationBar setTranslucent:NO];
//    [self.navigationController.navigationBar addSubview:image];
//    //[self.navigationController.navigationBar setCornerRadius:5];
//}
//-(void)rightBtnClick:(UIButton*)rightBtn
//{
//    rightBtn.selected = !rightBtn.selected;
//}

//#pragma mark - json 格式的 Get 请求
//-( void )jasonGetRequst{
//    NSString *urlString = @"http://apiv6.ixingji.com/ixingji/";
//    
//    // 网络请求管理者
//    AFHTTPRequestOperationManager *manager = [ AFHTTPRequestOperationManager manager];
//    
//    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//    
//    [manager GET:urlString parameters:nil
//        success :^( AFHTTPRequestOperation *operation, id responseObject)
//     {
//         NSDictionary  *dataDic = [NSJSONSerialization JSONObjectWithData :responseObject options : NSJSONReadingMutableContainers error : nil ];
//         
//         ModelBuyRoot *modelRoot = [ModelBuyRoot objectWithKeyValues:dataDic];
//         ModelBuyAttachment * modelAttachment = [ModelBuyAttachment objectWithKeyValues:modelRoot.attachment];
//         self.modelBuyAttachmentVenusesArr   = [ModelBuyItemInVenuses objectArrayWithKeyValuesArray:modelAttachment.venuses];
//         
//         [self.tableView reloadData];
//         
//     }
//        failure :^( AFHTTPRequestOperation *operation, NSError *error)
//     {
//         NSLog ( @"请求失败:%@" ,[error description ]);
//     }];
//    
//}

